package com.cn.jinl.domain;

import com.cn.jinl.utils.CommonUtil;
import com.google.common.collect.ImmutableMap;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class SysItem {
    private String id;

    private String itemName;

    private String itemCode;

    private String itemAlias;

    private String itemPrice;

    private String itemType;

    private String itemStatus;

    private String userId;

    private String userName;

    private String status;

    private Date createTime;

    private Date updateTime;

    private String repeat;


    public static final transient Map<String, String> STATUSMAP =
            ImmutableMap.of("0", "在用", "1", "停用");

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName == null ? null : itemName.trim();
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode == null ? null : itemCode.trim();
    }

    public String getItemAlias() {
        return itemAlias;
    }

    public void setItemAlias(String itemAlias) {
        this.itemAlias = itemAlias == null ? null : itemAlias.trim();
    }

    public String getItemPrice() {
        return itemPrice;
    }

    public void setItemPrice(String itemPrice) {
        this.itemPrice = itemPrice == null ? null : itemPrice.trim();
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType == null ? null : itemType.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getItemStatusCn() {
        return STATUSMAP.get(getItemStatus());
    }
    public String getItemStatus() {
        return itemStatus;
    }

    public void setItemStatus(String itemStatus) {
        this.itemStatus = itemStatus;
    }

    public String getRepeat() {
        return repeat;
    }

    public void setRepeat(String repeat) {
        this.repeat = repeat;
    }

    public String getCreateTimeFt(){
        String formatTime = CommonUtil.getStrTime(getCreateTime(),"yyyy-MM-dd HH:mm:ss");
        return formatTime;
    }
}
